<template>
  <mz-list-item :title="amount" :note="giveAmount" :show-arrow="false">
    <template v-slot:right>
      <view class="financelog-value-wrap">{{ date|formatDate }}</view>
    </template>
  </mz-list-item>
</template>

<script>
export default {
  components: {},
  props: {
    data: {
      type: Object,
      default() {
        return {};
      }
    }
  },
  computed: {
    amount() {
      return this.data.type == 1
        ? `充值 ${this.data.amount} 元`
        : `消费 ${this.data.amount} 元`;
    },
    date() {
      return this.data.createdAt;
    },
    giveAmount() {
      return (this.data.giveAmount && `送 ${this.data.giveAmount}`) || ``;
    }
  }
};
</script>
<style lang="scss" scoped>
.financelog-value-wrap {
  font-size: 28rpx;
}
</style>
